window: Don't invalidate cssnode during get_preferred_width()
authorBenjamin Otte <otte@redhat.com>
Sat, 14 Nov 2015 17:28:34 +0000 (18:28 +0100)
committerBenjamin Otte <otte@redhat.com>
Sat, 14 Nov 2015 17:32:08 +0000 (18:32 +0100)
commit55735cee2f05eca385f00c196bad05eb50c06822
tree834633aa3b14251c8adef53c94ccc1a62a4e856a
parent38bfec8ea4df8baec60e460bb1d418a01fa2e1d6
window: Don't invalidate cssnode during get_preferred_width()

Getting the shadow width must not call gtk_style_context_set_state()
because that will invalidate the node and cause a style-updated emission
which can cause gtk_widget_queue_resize() calls.

And calling queue_resize() from get_preferred_size() essentially means
the size is permanently invalid because you invalidate it while
querying it.

This causes flickering of windows when going from/to backdrop state. To
avoid this we either need to fix the theme to not have different shadow
sizes in those cases or we need to ensure the window doesn't flicker in
the first place.
gtk/gtkwindow.c